snapshot: Move structs into .c file
authorBenjamin Otte <otte@redhat.com>
Thu, 2 Jul 2020 20:59:40 +0000 (22:59 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 16 Jul 2020 16:09:57 +0000 (18:09 +0200)
They aren't used anywhere else.

gtk/gtksnapshot.c
gtk/gtksnapshotprivate.h

index ef479097502ce0cfc49b392cc2c7c96b47fb6487..3a2732428eb305f7ab94726960c4c3212bbf77cd 100644 (file)
  * use gtk_snapshot_new().
  */
 
+typedef struct _GtkSnapshotState GtkSnapshotState;
+
+typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshot      *snapshot,
+                                                    GtkSnapshotState *state,
+                                                    GskRenderNode   **nodes,
+                                                    guint             n_nodes);
+
+struct _GtkSnapshotState {
+  guint                  start_node_index;
+  guint                  n_nodes;
+
+  GskTransform *         transform;
+
+  GtkSnapshotCollectFunc collect_func;
+  union {
+    struct {
+      double             opacity;
+    } opacity;
+    struct {
+      double             radius;
+    } blur;
+    struct {
+      graphene_matrix_t matrix;
+      graphene_vec4_t offset;
+    } color_matrix;
+    struct {
+      graphene_rect_t bounds;
+      graphene_rect_t child_bounds;
+    } repeat;
+    struct {
+      graphene_rect_t bounds;
+    } clip;
+    struct {
+      GskRoundedRect bounds;
+    } rounded_clip;
+    struct {
+      gsize n_shadows;
+      GskShadow *shadows;
+      GskShadow a_shadow; /* Used if n_shadows == 1 */
+    } shadow;
+    struct {
+      GskBlendMode blend_mode;
+      GskRenderNode *bottom_node;
+    } blend;
+    struct {
+      double progress;
+      GskRenderNode *start_node;
+    } cross_fade;
+    struct {
+      char *message;
+    } debug;
+  } data;
+};
+
+/* This is a nasty little hack. We typedef GtkSnapshot to the fake object GdkSnapshot
+ * so that we don't need to typecast between them.
+ * After all, the GdkSnapshot only exist so poor language bindings don't trip. Hardcore
+ * C code can just blatantly ignore such layering violations with a typedef.
+ */
+struct _GdkSnapshot {
+  GObject                parent_instance; /* it's really GdkSnapshot, but don't tell anyone! */
+
+  GArray                *state_stack;
+  GPtrArray             *nodes;
+};
+
+struct _GtkSnapshotClass {
+  GObjectClass           parent_class; /* it's really GdkSnapshotClass, but don't tell anyone! */
+};
+
 G_DEFINE_TYPE (GtkSnapshot, gtk_snapshot, GDK_TYPE_SNAPSHOT)
 
 static void
index aebf5c384001dedd489447fded55a8a1a625c56a..99714c5a9909c614a14998c77f7f34c6ae9c9a43 100644 (file)
 
 G_BEGIN_DECLS
 
-typedef struct _GtkSnapshotState GtkSnapshotState;
-
-typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshot      *snapshot,
-                                                    GtkSnapshotState *state,
-                                                    GskRenderNode   **nodes,
-                                                    guint             n_nodes);
-
-struct _GtkSnapshotState {
-  guint                  start_node_index;
-  guint                  n_nodes;
-
-  GskTransform *         transform;
-
-  GtkSnapshotCollectFunc collect_func;
-  union {
-    struct {
-      double             opacity;
-    } opacity;
-    struct {
-      double             radius;
-    } blur;
-    struct {
-      graphene_matrix_t matrix;
-      graphene_vec4_t offset;
-    } color_matrix;
-    struct {
-      graphene_rect_t bounds;
-      graphene_rect_t child_bounds;
-    } repeat;
-    struct {
-      graphene_rect_t bounds;
-    } clip;
-    struct {
-      GskRoundedRect bounds;
-    } rounded_clip;
-    struct {
-      gsize n_shadows;
-      GskShadow *shadows;
-      GskShadow a_shadow; /* Used if n_shadows == 1 */
-    } shadow;
-    struct {
-      GskBlendMode blend_mode;
-      GskRenderNode *bottom_node;
-    } blend;
-    struct {
-      double progress;
-      GskRenderNode *start_node;
-    } cross_fade;
-    struct {
-      char *message;
-    } debug;
-  } data;
-};
-
-/* This is a nasty little hack. We typedef GtkSnapshot to the fake object GdkSnapshot
- * so that we don't need to typecast between them.
- * After all, the GdkSnapshot only exist so poor language bindings don't trip. Hardcore
- * C code can just blatantly ignore such layering violations with a typedef.
- */
-struct _GdkSnapshot {
-  GObject                parent_instance; /* it's really GdkSnapshot, but don't tell anyone! */
-
-  GArray                *state_stack;
-  GPtrArray             *nodes;
-};
-
-struct _GtkSnapshotClass {
-  GObjectClass           parent_class; /* it's really GdkSnapshotClass, but don't tell anyone! */
-};
-
 void                    gtk_snapshot_append_text                (GtkSnapshot            *snapshot,
                                                                  PangoFont              *font,
                                                                  PangoGlyphString       *glyphs,